<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS三角巧妙运用-京东秒杀价格</title>
    <style>
        .price{
            width: 160px;
            height: 24px;
            /* 父盒子下面两个span都要垂直居中,所以给父盒子加line-height,让子元素继承 */
            line-height: 24px;
            border: 1px solid red;
            margin: 0 auto;
        }

        .miaosha{
            position: relative;
            float: left;
            width: 90px;
            height: 100%;
            text-align: center;
            color: #fff;
            font-weight: 700;
            margin-right: 8px;
            background-color: red;
        }

        .triangle{
            position:absolute;
            top: 0;
            right: 0;
            width: 0;
            height: 0;
            border-color: transparent #fff transparent transparent;
            border-style: solid;
            border-width: 24px 10px 0 0;
        }

        .origin{
            font-size: 12px;
            color: gray;
            text-decoration: line-through;
        }
    </style>
</head>
<body>
    <div class="price">
        <span class="miaosha" >￥1650
            <i class="triangle" ></i>
        </span>
        <span class="origin" >￥5650</span>
    </div>
</body>
</html>